﻿namespace CKFinder.Settings
{
    using System;
    using System.Collections;

    public class ResourceTypeManager
    {
        private Hashtable _ResourceTypes = new Hashtable();
        private ArrayList _ResourceTypesList = new ArrayList();

        public ResourceType Add(string name)
        {
            ResourceType type = new ResourceType(name);
            this._ResourceTypesList.Add(type);
            this._ResourceTypes.Add(name, type);
            return type;
        }

        public ResourceType GetByIndex(int index)
        {
            return (ResourceType) this._ResourceTypesList[index];
        }

        public ResourceType GetByName(string name)
        {
            return (ResourceType) this._ResourceTypes[name];
        }

        public int Count
        {
            get
            {
                return this._ResourceTypesList.Count;
            }
        }
    }
}

